<?php

class SessionController extends Controller
{
    /*
    *
    *
    */
    public function actionAdd()
    {
        $products=['session_id'=>1,'name'=>'茅台酒'];


        Yii::app()->cache->set('product',
            $products,
            0);



    }

    /*
    * 获取列表
    *
    */
    public function actiongetinfo()
    {

        try {
            //检测
            $session_id = Util::getParamNotEmpty("session_id");

            $value = Yii::app()->cache->get($session_id);

            if(empty($value)==false)
                Util::responseObj($value);

            else
                Util::responseErrorMsg("not exist");





        } catch (Exception $e) {
            Util::responseErrorMsg($e->getMessage());

        }
    }
}